Skip to content

Fix a bug with the cache in the BDD to exprt conversion #5005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2019

Conversation

romainbrenguier
Copy link
Contributor

There was a bug in which the result for a node and for it's complement would have been stored in the same map entry, this happens with the Cudd library which uses complemented nodes (a node and it's negation are stored at the same address).

  • Each commit message has a non-empty body, explaining why the change was made.
  • [na] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [na] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [na] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: be42c64).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122950506

return a.op0();
return not_exprt{a};
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use boolean_negate?

Because of how the cache is handled, the expression for one node and its
complement will collide in the cache. It is better to get rid of the
complement argument and only reason about nodes.
This is more robust as the expression a&!b could equivalently be written
!b&a, !(!a|b), !(b|!a)...
This tests a few more cases with BDDs.
In particular, the last case would have failed before the bugfix for the
BDD cache.
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️
Passed Diffblue compatibility checks (cbmc commit: b8850ed).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122966717

@romainbrenguier romainbrenguier merged commit 1a256b8 into diffblue:develop Aug 13, 2019
@romainbrenguier romainbrenguier deleted the bugfix/bdd-cache branch August 13, 2019 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants